home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / editors / emcs1857 / 1857sr~1.zoo / lisp / trans-table.el < prev   
Encoding:
Text File  |  1992-01-24  |  1.8 KB  |  64 lines

  1. ;; Functions for dealing with trans tables.
  2. ;; Copyright (C) 1987 Free Software Foundation, Inc.
  3.  
  4. ;; This file is part of GNU Emacs.
  5.  
  6. ;; GNU Emacs is distributed in the hope that it will be useful,
  7. ;; but WITHOUT ANY WARRANTY.  No author or distributor
  8. ;; accepts responsibility to anyone for the consequences of using it
  9. ;; or for whether it serves any particular purpose or works at all,
  10. ;; unless he says so in writing.  Refer to the GNU Emacs General Public
  11. ;; License for full details.
  12.  
  13. ;; Everyone is granted permission to copy, modify and redistribute
  14. ;; GNU Emacs, but only under the conditions described in the
  15. ;; GNU Emacs General Public License.   A copy of this license is
  16. ;; supposed to have been given to you along with GNU Emacs so you
  17. ;; can know your rights and responsibilities.  It should be in a
  18. ;; file named COPYING.  Among other things, the copyright notice
  19. ;; and this notice must be preserved on all copies.
  20.  
  21.  
  22. ;; Written by Howard Gayle.  See case-table.el for details.
  23.  
  24. (require 'case-table)
  25.  
  26. (defun describe-downcase-table ()
  27.    "Describe the downcase table of the current buffer."
  28.    (interactive)
  29.    (describe-trans-table (downcase-table))
  30. )
  31.  
  32. (defun describe-trans-table (tt)
  33.    "Describe the given trans table in a help buffer.  Don't
  34. mention identity translations."
  35.    (let  (
  36.            (i 0) ; Current character.
  37.      j     ; Translated character.
  38.      )
  39.       (with-output-to-temp-buffer "*Help*"
  40.      (while (<= i 255)
  41.         (setq j (get-trans-table-to i tt))
  42.         (if (not (= i j))
  43.            (progn
  44.                  (describe-character i)
  45.           (princ "->")
  46.                  (describe-character j)
  47.           (princ "\n")
  48.            )
  49.         )
  50.         (setq i (1+ i))
  51.      )
  52.      (print-help-return-message)
  53.       )
  54.    )
  55. )
  56.  
  57. (defun describe-upcase-table ()
  58.    "Describe the upcase table of the current buffer."
  59.    (interactive)
  60.    (describe-trans-table (upcase-table))
  61. )
  62.  
  63. (provide 'trans-table)
  64.